.class public Lorg/jboss/netty/handler/codec/spdy/SpdyFrameEncoder;
.super Lorg/jboss/netty/handler/codec/oneone/OneToOneEncoder;
.source "SpdyFrameEncoder.java"


# instance fields
.field private final headerBlockCompressor:Lorg/jboss/netty/handler/codec/embedder/EncoderEmbedder;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lorg/jboss/netty/handler/codec/embedder/EncoderEmbedder",
            "<",
            "Lorg/jboss/netty/buffer/ChannelBuffer;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>()V
    .locals 6

    .prologue
    .line 40
    invoke-direct {p0}, Lorg/jboss/netty/handler/codec/oneone/OneToOneEncoder;-><init>()V

    .line 36
    new-instance v0, Lorg/jboss/netty/handler/codec/embedder/EncoderEmbedder;

    const/4 v1, 0x1

    new-array v1, v1, [Lorg/jboss/netty/channel/ChannelDownstreamHandler;

    const/4 v2, 0x0

    new-instance v3, Lorg/jboss/netty/handler/codec/compression/ZlibEncoder;

    const/16 v4, 0x9

    sget-object v5, Lorg/jboss/netty/handler/codec/spdy/SpdyCodecUtil;->SPDY_DICT:[B

    invoke-direct {v3, v4, v5}, Lorg/jboss/netty/handler/codec/compression/ZlibEncoder;-><init>(I[B)V

    aput-object v3, v1, v2

    invoke-direct {v0, v1}, Lorg/jboss/netty/handler/codec/embedder/EncoderEmbedder;-><init>([Lorg/jboss/netty/channel/ChannelDownstreamHandler;)V

    iput-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdyFrameEncoder;->headerBlockCompressor:Lorg/jboss/netty/handler/codec/embedder/EncoderEmbedder;

    .line 41
    return-void
.end method

.method private declared-synchronized compressHeaderBlock(Lorg/jboss/netty/buffer/ChannelBuffer;)Lorg/jboss/netty/buffer/ChannelBuffer;
    .locals 1
    .parameter "uncompressed"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    .line 251
    monitor-enter p0

    :try_start_0
    invoke-interface {p1}, Lorg/jboss/netty/buffer/ChannelBuffer;->readableBytes()I

    move-result v0

    if-nez v0, :cond_0

    .line 252
    sget-object v0, Lorg/jboss/netty/buffer/ChannelBuffers;->EMPTY_BUFFER:Lorg/jboss/netty/buffer/ChannelBuffer;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 255
    :goto_0
    monitor-exit p0

    return-object v0

    .line 254
    :cond_0
    :try_start_1
    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdyFrameEncoder;->headerBlockCompressor:Lorg/jboss/netty/handler/codec/embedder/EncoderEmbedder;

    invoke-virtual {v0, p1}, Lorg/jboss/netty/handler/codec/embedder/EncoderEmbedder;->offer(Ljava/lang/Object;)Z

    .line 255
    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdyFrameEncoder;->headerBlockCompressor:Lorg/jboss/netty/handler/codec/embedder/EncoderEmbedder;

    invoke-virtual {v0}, Lorg/jboss/netty/handler/codec/embedder/EncoderEmbedder;->poll()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lorg/jboss/netty/buffer/ChannelBuffer;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 251
    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method private encodeHeaderBlock(Lorg/jboss/netty/handler/codec/spdy/SpdyHeaderBlock;)Lorg/jboss/netty/buffer/ChannelBuffer;
    .locals 14
    .parameter "headerFrame"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    const v13, 0xffff

    .line 213
    invoke-interface {p1}, Lorg/jboss/netty/handler/codec/spdy/SpdyHeaderBlock;->getHeaderNames()Ljava/util/Set;

    move-result-object v5

    .line 214
    .local v5, names:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    invoke-interface {v5}, Ljava/util/Set;->size()I

    move-result v6

    .line 215
    .local v6, numHeaders:I
    if-nez v6, :cond_1

    .line 216
    sget-object v0, Lorg/jboss/netty/buffer/ChannelBuffers;->EMPTY_BUFFER:Lorg/jboss/netty/buffer/ChannelBuffer;

    .line 246
    :cond_0
    return-object v0

    .line 218
    :cond_1
    if-le v6, v13, :cond_2

    .line 219
    new-instance v11, Ljava/lang/IllegalArgumentException;

    const-string v12, "header block contains too many headers"

    invoke-direct {v11, v12}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v11

    .line 222
    :cond_2
    sget-object v11, Ljava/nio/ByteOrder;->BIG_ENDIAN:Ljava/nio/ByteOrder;

    const/16 v12, 0x100

    invoke-static {v11, v12}, Lorg/jboss/netty/buffer/ChannelBuffers;->dynamicBuffer(Ljava/nio/ByteOrder;I)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v0

    .line 224
    .local v0, headerBlock:Lorg/jboss/netty/buffer/ChannelBuffer;
    invoke-interface {v0, v6}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 225
    invoke-interface {v5}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v11

    if-eqz v11, :cond_0

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/String;

    .line 226
    .local v3, name:Ljava/lang/String;
    const-string v11, "UTF-8"

    invoke-virtual {v3, v11}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v4

    .line 227
    .local v4, nameBytes:[B
    array-length v11, v4

    invoke-interface {v0, v11}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 228
    invoke-interface {v0, v4}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeBytes([B)V

    .line 229
    invoke-interface {v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writerIndex()I

    move-result v7

    .line 230
    .local v7, savedIndex:I
    const/4 v10, 0x0

    .line 231
    .local v10, valueLength:I
    invoke-interface {v0, v10}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 232
    invoke-interface {p1, v3}, Lorg/jboss/netty/handler/codec/spdy/SpdyHeaderBlock;->getHeaders(Ljava/lang/String;)Ljava/util/List;

    move-result-object v11

    invoke-interface {v11}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v2

    .local v2, i$:Ljava/util/Iterator;
    :goto_1
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v11

    if-eqz v11, :cond_3

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v8

    check-cast v8, Ljava/lang/String;

    .line 233
    .local v8, value:Ljava/lang/String;
    const-string v11, "UTF-8"

    invoke-virtual {v8, v11}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v9

    .line 234
    .local v9, valueBytes:[B
    invoke-interface {v0, v9}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeBytes([B)V

    .line 235
    const/4 v11, 0x0

    invoke-interface {v0, v11}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeByte(I)V

    .line 236
    array-length v11, v9

    add-int/lit8 v11, v11, 0x1

    add-int/2addr v10, v11

    .line 237
    goto :goto_1

    .line 238
    .end local v8           #value:Ljava/lang/String;
    .end local v9           #valueBytes:[B
    :cond_3
    add-int/lit8 v10, v10, -0x1

    .line 239
    if-le v10, v13, :cond_4

    .line 240
    new-instance v11, Ljava/lang/IllegalArgumentException;

    new-instance v12, Ljava/lang/StringBuilder;

    invoke-direct {v12}, Ljava/lang/StringBuilder;-><init>()V

    const-string v13, "header exceeds allowable length: "

    invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v12

    invoke-virtual {v12, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v12

    invoke-virtual {v12}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v12

    invoke-direct {v11, v12}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v11

    .line 243
    :cond_4
    invoke-interface {v0, v7, v10}, Lorg/jboss/netty/buffer/ChannelBuffer;->setShort(II)V

    .line 244
    invoke-interface {v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writerIndex()I

    move-result v11

    add-int/lit8 v11, v11, -0x1

    invoke-interface {v0, v11}, Lorg/jboss/netty/buffer/ChannelBuffer;->writerIndex(I)V

    goto :goto_0
.end method


# virtual methods
.method protected encode(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/Channel;Ljava/lang/Object;)Ljava/lang/Object;
    .locals 24
    .parameter "ctx"
    .parameter "channel"
    .parameter "msg"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    .line 48
    move-object/from16 v0, p3

    instance-of v0, v0, Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;

    move/from16 v22, v0

    if-eqz v22, :cond_3

    move-object/from16 v14, p3

    .line 50
    check-cast v14, Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;

    .line 51
    .local v14, spdyDataFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;
    invoke-interface {v14}, Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;->getData()Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v5

    .line 52
    .local v5, data:Lorg/jboss/netty/buffer/ChannelBuffer;
    invoke-interface {v14}, Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;->isLast()Z

    move-result v22

    if-eqz v22, :cond_2

    const/4 v6, 0x1

    .line 53
    .local v6, flags:B
    :goto_0
    invoke-interface {v14}, Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;->isCompressed()Z

    move-result v22

    if-eqz v22, :cond_0

    .line 54
    or-int/lit8 v22, v6, 0x2

    move/from16 v0, v22

    int-to-byte v6, v0

    .line 56
    :cond_0
    sget-object v22, Ljava/nio/ByteOrder;->BIG_ENDIAN:Ljava/nio/ByteOrder;

    const/16 v23, 0x8

    invoke-static/range {v22 .. v23}, Lorg/jboss/netty/buffer/ChannelBuffers;->buffer(Ljava/nio/ByteOrder;I)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v8

    .line 58
    .local v8, header:Lorg/jboss/netty/buffer/ChannelBuffer;
    invoke-interface {v14}, Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;->getStreamID()I

    move-result v22

    const v23, 0x7fffffff

    and-int v22, v22, v23

    move/from16 v0, v22

    invoke-interface {v8, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    .line 59
    invoke-interface {v8, v6}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeByte(I)V

    .line 60
    invoke-interface {v5}, Lorg/jboss/netty/buffer/ChannelBuffer;->readableBytes()I

    move-result v22

    move/from16 v0, v22

    invoke-interface {v8, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeMedium(I)V

    .line 61
    const/16 v22, 0x2

    move/from16 v0, v22

    new-array v0, v0, [Lorg/jboss/netty/buffer/ChannelBuffer;

    move-object/from16 v22, v0

    const/16 v23, 0x0

    aput-object v8, v22, v23

    const/16 v23, 0x1

    aput-object v5, v22, v23

    invoke-static/range {v22 .. v22}, Lorg/jboss/netty/buffer/ChannelBuffers;->wrappedBuffer([Lorg/jboss/netty/buffer/ChannelBuffer;)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v7

    .line 208
    .end local v5           #data:Lorg/jboss/netty/buffer/ChannelBuffer;
    .end local v6           #flags:B
    .end local v8           #header:Lorg/jboss/netty/buffer/ChannelBuffer;
    .end local v14           #spdyDataFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;
    :cond_1
    :goto_1
    return-object v7

    .line 52
    .restart local v5       #data:Lorg/jboss/netty/buffer/ChannelBuffer;
    .restart local v14       #spdyDataFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;
    :cond_2
    const/4 v6, 0x0

    goto :goto_0

    .line 63
    .end local v5           #data:Lorg/jboss/netty/buffer/ChannelBuffer;
    .end local v14           #spdyDataFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyDataFrame;
    :cond_3
    move-object/from16 v0, p3

    instance-of v0, v0, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;

    move/from16 v22, v0

    if-eqz v22, :cond_8

    move-object/from16 v21, p3

    .line 65
    check-cast v21, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;

    .line 66
    .local v21, spdySynStreamFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;
    move-object/from16 v0, p0

    move-object/from16 v1, v21

    invoke-direct {v0, v1}, Lorg/jboss/netty/handler/codec/spdy/SpdyFrameEncoder;->encodeHeaderBlock(Lorg/jboss/netty/handler/codec/spdy/SpdyHeaderBlock;)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v22

    move-object/from16 v0, p0

    move-object/from16 v1, v22

    invoke-direct {v0, v1}, Lorg/jboss/netty/handler/codec/spdy/SpdyFrameEncoder;->compressHeaderBlock(Lorg/jboss/netty/buffer/ChannelBuffer;)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v5

    .line 68
    .restart local v5       #data:Lorg/jboss/netty/buffer/ChannelBuffer;
    invoke-interface/range {v21 .. v21}, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;->isLast()Z

    move-result v22

    if-eqz v22, :cond_6

    const/4 v6, 0x1

    .line 69
    .restart local v6       #flags:B
    :goto_2
    invoke-interface/range {v21 .. v21}, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;->isUnidirectional()Z

    move-result v22

    if-eqz v22, :cond_4

    .line 70
    or-int/lit8 v22, v6, 0x2

    move/from16 v0, v22

    int-to-byte v6, v0

    .line 72
    :cond_4
    invoke-interface {v5}, Lorg/jboss/netty/buffer/ChannelBuffer;->readableBytes()I

    move-result v9

    .line 73
    .local v9, headerBlockLength:I
    if-nez v9, :cond_7

    const/16 v12, 0xc

    .line 74
    .local v12, length:I
    :goto_3
    sget-object v22, Ljava/nio/ByteOrder;->BIG_ENDIAN:Ljava/nio/ByteOrder;

    add-int/lit8 v23, v12, 0x8

    invoke-static/range {v22 .. v23}, Lorg/jboss/netty/buffer/ChannelBuffers;->buffer(Ljava/nio/ByteOrder;I)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v7

    .line 76
    .local v7, frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    const v22, 0x8002

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 77
    const/16 v22, 0x1

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 78
    invoke-interface {v7, v6}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeByte(I)V

    .line 79
    invoke-interface {v7, v12}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeMedium(I)V

    .line 80
    invoke-interface/range {v21 .. v21}, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;->getStreamID()I

    move-result v22

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    .line 81
    invoke-interface/range {v21 .. v21}, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;->getAssociatedToStreamID()I

    move-result v22

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    .line 82
    invoke-interface/range {v21 .. v21}, Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;->getPriority()B

    move-result v22

    move/from16 v0, v22

    int-to-short v0, v0

    move/from16 v22, v0

    shl-int/lit8 v22, v22, 0xe

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 83
    invoke-interface {v5}, Lorg/jboss/netty/buffer/ChannelBuffer;->readableBytes()I

    move-result v22

    if-nez v22, :cond_5

    .line 84
    const/16 v22, 0x0

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 86
    :cond_5
    const/16 v22, 0x2

    move/from16 v0, v22

    new-array v0, v0, [Lorg/jboss/netty/buffer/ChannelBuffer;

    move-object/from16 v22, v0

    const/16 v23, 0x0

    aput-object v7, v22, v23

    const/16 v23, 0x1

    aput-object v5, v22, v23

    invoke-static/range {v22 .. v22}, Lorg/jboss/netty/buffer/ChannelBuffers;->wrappedBuffer([Lorg/jboss/netty/buffer/ChannelBuffer;)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v7

    goto/16 :goto_1

    .line 68
    .end local v6           #flags:B
    .end local v7           #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    .end local v9           #headerBlockLength:I
    .end local v12           #length:I
    :cond_6
    const/4 v6, 0x0

    goto :goto_2

    .line 73
    .restart local v6       #flags:B
    .restart local v9       #headerBlockLength:I
    :cond_7
    add-int/lit8 v12, v9, 0xa

    goto :goto_3

    .line 88
    .end local v5           #data:Lorg/jboss/netty/buffer/ChannelBuffer;
    .end local v6           #flags:B
    .end local v9           #headerBlockLength:I
    .end local v21           #spdySynStreamFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySynStreamFrame;
    :cond_8
    move-object/from16 v0, p3

    instance-of v0, v0, Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;

    move/from16 v22, v0

    if-eqz v22, :cond_c

    move-object/from16 v20, p3

    .line 90
    check-cast v20, Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;

    .line 91
    .local v20, spdySynReplyFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;
    move-object/from16 v0, p0

    move-object/from16 v1, v20

    invoke-direct {v0, v1}, Lorg/jboss/netty/handler/codec/spdy/SpdyFrameEncoder;->encodeHeaderBlock(Lorg/jboss/netty/handler/codec/spdy/SpdyHeaderBlock;)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v22

    move-object/from16 v0, p0

    move-object/from16 v1, v22

    invoke-direct {v0, v1}, Lorg/jboss/netty/handler/codec/spdy/SpdyFrameEncoder;->compressHeaderBlock(Lorg/jboss/netty/buffer/ChannelBuffer;)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v5

    .line 93
    .restart local v5       #data:Lorg/jboss/netty/buffer/ChannelBuffer;
    invoke-interface/range {v20 .. v20}, Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;->isLast()Z

    move-result v22

    if-eqz v22, :cond_9

    const/4 v6, 0x1

    .line 94
    .restart local v6       #flags:B
    :goto_4
    invoke-interface {v5}, Lorg/jboss/netty/buffer/ChannelBuffer;->readableBytes()I

    move-result v9

    .line 95
    .restart local v9       #headerBlockLength:I
    if-nez v9, :cond_a

    const/16 v12, 0x8

    .line 96
    .restart local v12       #length:I
    :goto_5
    sget-object v22, Ljava/nio/ByteOrder;->BIG_ENDIAN:Ljava/nio/ByteOrder;

    add-int/lit8 v23, v12, 0x8

    invoke-static/range {v22 .. v23}, Lorg/jboss/netty/buffer/ChannelBuffers;->buffer(Ljava/nio/ByteOrder;I)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v7

    .line 98
    .restart local v7       #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    const v22, 0x8002

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 99
    const/16 v22, 0x2

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 100
    invoke-interface {v7, v6}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeByte(I)V

    .line 101
    invoke-interface {v7, v12}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeMedium(I)V

    .line 102
    invoke-interface/range {v20 .. v20}, Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;->getStreamID()I

    move-result v22

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    .line 103
    invoke-interface {v5}, Lorg/jboss/netty/buffer/ChannelBuffer;->readableBytes()I

    move-result v22

    if-nez v22, :cond_b

    .line 104
    const/16 v22, 0x0

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    .line 108
    :goto_6
    const/16 v22, 0x2

    move/from16 v0, v22

    new-array v0, v0, [Lorg/jboss/netty/buffer/ChannelBuffer;

    move-object/from16 v22, v0

    const/16 v23, 0x0

    aput-object v7, v22, v23

    const/16 v23, 0x1

    aput-object v5, v22, v23

    invoke-static/range {v22 .. v22}, Lorg/jboss/netty/buffer/ChannelBuffers;->wrappedBuffer([Lorg/jboss/netty/buffer/ChannelBuffer;)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v7

    goto/16 :goto_1

    .line 93
    .end local v6           #flags:B
    .end local v7           #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    .end local v9           #headerBlockLength:I
    .end local v12           #length:I
    :cond_9
    const/4 v6, 0x0

    goto :goto_4

    .line 95
    .restart local v6       #flags:B
    .restart local v9       #headerBlockLength:I
    :cond_a
    add-int/lit8 v12, v9, 0x6

    goto :goto_5

    .line 106
    .restart local v7       #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    .restart local v12       #length:I
    :cond_b
    const/16 v22, 0x0

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    goto :goto_6

    .line 110
    .end local v5           #data:Lorg/jboss/netty/buffer/ChannelBuffer;
    .end local v6           #flags:B
    .end local v7           #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    .end local v9           #headerBlockLength:I
    .end local v12           #length:I
    .end local v20           #spdySynReplyFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySynReplyFrame;
    :cond_c
    move-object/from16 v0, p3

    instance-of v0, v0, Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;

    move/from16 v22, v0

    if-eqz v22, :cond_d

    move-object/from16 v18, p3

    .line 112
    check-cast v18, Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;

    .line 113
    .local v18, spdyRstStreamFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;
    sget-object v22, Ljava/nio/ByteOrder;->BIG_ENDIAN:Ljava/nio/ByteOrder;

    const/16 v23, 0x10

    invoke-static/range {v22 .. v23}, Lorg/jboss/netty/buffer/ChannelBuffers;->buffer(Ljava/nio/ByteOrder;I)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v7

    .line 115
    .restart local v7       #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    const v22, 0x8002

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 116
    const/16 v22, 0x3

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 117
    const/16 v22, 0x8

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    .line 118
    invoke-interface/range {v18 .. v18}, Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;->getStreamID()I

    move-result v22

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    .line 119
    invoke-interface/range {v18 .. v18}, Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;->getStatus()Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;

    move-result-object v22

    invoke-virtual/range {v22 .. v22}, Lorg/jboss/netty/handler/codec/spdy/SpdyStreamStatus;->getCode()I

    move-result v22

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    goto/16 :goto_1

    .line 122
    .end local v7           #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    .end local v18           #spdyRstStreamFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyRstStreamFrame;
    :cond_d
    move-object/from16 v0, p3

    instance-of v0, v0, Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;

    move/from16 v22, v0

    if-eqz v22, :cond_11

    move-object/from16 v19, p3

    .line 124
    check-cast v19, Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;

    .line 125
    .local v19, spdySettingsFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;
    invoke-interface/range {v19 .. v19}, Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;->clearPreviouslyPersistedSettings()Z

    move-result v22

    if-eqz v22, :cond_10

    const/4 v6, 0x1

    .line 127
    .restart local v6       #flags:B
    :goto_7
    invoke-interface/range {v19 .. v19}, Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;->getIDs()Ljava/util/Set;

    move-result-object v4

    .line 128
    .local v4, IDs:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/Integer;>;"
    invoke-interface {v4}, Ljava/util/Set;->size()I

    move-result v13

    .line 129
    .local v13, numEntries:I
    mul-int/lit8 v22, v13, 0x8

    add-int/lit8 v12, v22, 0x4

    .line 130
    .restart local v12       #length:I
    sget-object v22, Ljava/nio/ByteOrder;->BIG_ENDIAN:Ljava/nio/ByteOrder;

    add-int/lit8 v23, v12, 0x8

    invoke-static/range {v22 .. v23}, Lorg/jboss/netty/buffer/ChannelBuffers;->buffer(Ljava/nio/ByteOrder;I)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v7

    .line 132
    .restart local v7       #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    const v22, 0x8002

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 133
    const/16 v22, 0x4

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 134
    invoke-interface {v7, v6}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeByte(I)V

    .line 135
    invoke-interface {v7, v12}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeMedium(I)V

    .line 136
    invoke-interface {v7, v13}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    .line 137
    invoke-interface {v4}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v10

    .local v10, i$:Ljava/util/Iterator;
    :goto_8
    invoke-interface {v10}, Ljava/util/Iterator;->hasNext()Z

    move-result v22

    if-eqz v22, :cond_1

    invoke-interface {v10}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/Integer;

    .line 138
    .local v2, ID:Ljava/lang/Integer;
    invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I

    move-result v11

    .line 139
    .local v11, id:I
    const/4 v3, 0x0

    .line 140
    .local v3, ID_flags:B
    move-object/from16 v0, v19

    invoke-interface {v0, v11}, Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;->persistValue(I)Z

    move-result v22

    if-eqz v22, :cond_e

    .line 141
    const/16 v22, 0x1

    move/from16 v0, v22

    int-to-byte v3, v0

    .line 143
    :cond_e
    move-object/from16 v0, v19

    invoke-interface {v0, v11}, Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;->isPersisted(I)Z

    move-result v22

    if-eqz v22, :cond_f

    .line 144
    or-int/lit8 v22, v3, 0x2

    move/from16 v0, v22

    int-to-byte v3, v0

    .line 149
    :cond_f
    shr-int/lit8 v22, v11, 0x0

    move/from16 v0, v22

    and-int/lit16 v0, v0, 0xff

    move/from16 v22, v0

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeByte(I)V

    .line 150
    shr-int/lit8 v22, v11, 0x8

    move/from16 v0, v22

    and-int/lit16 v0, v0, 0xff

    move/from16 v22, v0

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeByte(I)V

    .line 151
    shr-int/lit8 v22, v11, 0x10

    move/from16 v0, v22

    and-int/lit16 v0, v0, 0xff

    move/from16 v22, v0

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeByte(I)V

    .line 152
    invoke-interface {v7, v3}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeByte(I)V

    .line 153
    move-object/from16 v0, v19

    invoke-interface {v0, v11}, Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;->getValue(I)I

    move-result v22

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    goto :goto_8

    .line 125
    .end local v2           #ID:Ljava/lang/Integer;
    .end local v3           #ID_flags:B
    .end local v4           #IDs:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/Integer;>;"
    .end local v6           #flags:B
    .end local v7           #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    .end local v10           #i$:Ljava/util/Iterator;
    .end local v11           #id:I
    .end local v12           #length:I
    .end local v13           #numEntries:I
    :cond_10
    const/4 v6, 0x0

    goto/16 :goto_7

    .line 157
    .end local v19           #spdySettingsFrame:Lorg/jboss/netty/handler/codec/spdy/SpdySettingsFrame;
    :cond_11
    move-object/from16 v0, p3

    instance-of v0, v0, Lorg/jboss/netty/handler/codec/spdy/SpdyNoOpFrame;

    move/from16 v22, v0

    if-eqz v22, :cond_12

    .line 159
    sget-object v22, Ljava/nio/ByteOrder;->BIG_ENDIAN:Ljava/nio/ByteOrder;

    const/16 v23, 0x8

    invoke-static/range {v22 .. v23}, Lorg/jboss/netty/buffer/ChannelBuffers;->buffer(Ljava/nio/ByteOrder;I)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v7

    .line 161
    .restart local v7       #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    const v22, 0x8002

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 162
    const/16 v22, 0x5

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 163
    const/16 v22, 0x0

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    goto/16 :goto_1

    .line 166
    .end local v7           #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    :cond_12
    move-object/from16 v0, p3

    instance-of v0, v0, Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;

    move/from16 v22, v0

    if-eqz v22, :cond_13

    move-object/from16 v17, p3

    .line 168
    check-cast v17, Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;

    .line 169
    .local v17, spdyPingFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;
    sget-object v22, Ljava/nio/ByteOrder;->BIG_ENDIAN:Ljava/nio/ByteOrder;

    const/16 v23, 0xc

    invoke-static/range {v22 .. v23}, Lorg/jboss/netty/buffer/ChannelBuffers;->buffer(Ljava/nio/ByteOrder;I)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v7

    .line 171
    .restart local v7       #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    const v22, 0x8002

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 172
    const/16 v22, 0x6

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 173
    const/16 v22, 0x4

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    .line 174
    invoke-interface/range {v17 .. v17}, Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;->getID()I

    move-result v22

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    goto/16 :goto_1

    .line 177
    .end local v7           #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    .end local v17           #spdyPingFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyPingFrame;
    :cond_13
    move-object/from16 v0, p3

    instance-of v0, v0, Lorg/jboss/netty/handler/codec/spdy/SpdyGoAwayFrame;

    move/from16 v22, v0

    if-eqz v22, :cond_14

    move-object/from16 v15, p3

    .line 179
    check-cast v15, Lorg/jboss/netty/handler/codec/spdy/SpdyGoAwayFrame;

    .line 180
    .local v15, spdyGoAwayFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyGoAwayFrame;
    sget-object v22, Ljava/nio/ByteOrder;->BIG_ENDIAN:Ljava/nio/ByteOrder;

    const/16 v23, 0xc

    invoke-static/range {v22 .. v23}, Lorg/jboss/netty/buffer/ChannelBuffers;->buffer(Ljava/nio/ByteOrder;I)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v7

    .line 182
    .restart local v7       #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    const v22, 0x8002

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 183
    const/16 v22, 0x7

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 184
    const/16 v22, 0x4

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    .line 185
    invoke-interface {v15}, Lorg/jboss/netty/handler/codec/spdy/SpdyGoAwayFrame;->getLastGoodStreamID()I

    move-result v22

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    goto/16 :goto_1

    .line 188
    .end local v7           #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    .end local v15           #spdyGoAwayFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyGoAwayFrame;
    :cond_14
    move-object/from16 v0, p3

    instance-of v0, v0, Lorg/jboss/netty/handler/codec/spdy/SpdyHeadersFrame;

    move/from16 v22, v0

    if-eqz v22, :cond_17

    move-object/from16 v16, p3

    .line 190
    check-cast v16, Lorg/jboss/netty/handler/codec/spdy/SpdyHeadersFrame;

    .line 191
    .local v16, spdyHeadersFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyHeadersFrame;
    move-object/from16 v0, p0

    move-object/from16 v1, v16

    invoke-direct {v0, v1}, Lorg/jboss/netty/handler/codec/spdy/SpdyFrameEncoder;->encodeHeaderBlock(Lorg/jboss/netty/handler/codec/spdy/SpdyHeaderBlock;)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v22

    move-object/from16 v0, p0

    move-object/from16 v1, v22

    invoke-direct {v0, v1}, Lorg/jboss/netty/handler/codec/spdy/SpdyFrameEncoder;->compressHeaderBlock(Lorg/jboss/netty/buffer/ChannelBuffer;)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v5

    .line 193
    .restart local v5       #data:Lorg/jboss/netty/buffer/ChannelBuffer;
    invoke-interface {v5}, Lorg/jboss/netty/buffer/ChannelBuffer;->readableBytes()I

    move-result v9

    .line 194
    .restart local v9       #headerBlockLength:I
    if-nez v9, :cond_16

    const/4 v12, 0x4

    .line 195
    .restart local v12       #length:I
    :goto_9
    sget-object v22, Ljava/nio/ByteOrder;->BIG_ENDIAN:Ljava/nio/ByteOrder;

    add-int/lit8 v23, v12, 0x8

    invoke-static/range {v22 .. v23}, Lorg/jboss/netty/buffer/ChannelBuffers;->buffer(Ljava/nio/ByteOrder;I)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v7

    .line 197
    .restart local v7       #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    const v22, 0x8002

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 198
    const/16 v22, 0x8

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 199
    invoke-interface {v7, v12}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    .line 200
    invoke-interface/range {v16 .. v16}, Lorg/jboss/netty/handler/codec/spdy/SpdyHeadersFrame;->getStreamID()I

    move-result v22

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeInt(I)V

    .line 201
    invoke-interface {v5}, Lorg/jboss/netty/buffer/ChannelBuffer;->readableBytes()I

    move-result v22

    if-eqz v22, :cond_15

    .line 202
    const/16 v22, 0x0

    move/from16 v0, v22

    invoke-interface {v7, v0}, Lorg/jboss/netty/buffer/ChannelBuffer;->writeShort(I)V

    .line 204
    :cond_15
    const/16 v22, 0x2

    move/from16 v0, v22

    new-array v0, v0, [Lorg/jboss/netty/buffer/ChannelBuffer;

    move-object/from16 v22, v0

    const/16 v23, 0x0

    aput-object v7, v22, v23

    const/16 v23, 0x1

    aput-object v5, v22, v23

    invoke-static/range {v22 .. v22}, Lorg/jboss/netty/buffer/ChannelBuffers;->wrappedBuffer([Lorg/jboss/netty/buffer/ChannelBuffer;)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v7

    goto/16 :goto_1

    .line 194
    .end local v7           #frame:Lorg/jboss/netty/buffer/ChannelBuffer;
    .end local v12           #length:I
    :cond_16
    add-int/lit8 v12, v9, 0x6

    goto :goto_9

    .end local v5           #data:Lorg/jboss/netty/buffer/ChannelBuffer;
    .end local v9           #headerBlockLength:I
    .end local v16           #spdyHeadersFrame:Lorg/jboss/netty/handler/codec/spdy/SpdyHeadersFrame;
    :cond_17
    move-object/from16 v7, p3

    .line 208
    goto/16 :goto_1
.end method
